//
// Created by 沈昊 on 2021/12/6.
//
#include <oss/oss.hpp>
#include <Util/logger.h>
int main(){

    using namespace toolkit;
    //初始化日志系统
    using namespace toolkit;
    Logger::Instance().add(std::make_shared<ConsoleChannel> ());
    Logger::Instance().add(std::make_shared<FileChannel>());
    Logger::Instance().setWriter(std::make_shared<AsyncLogWriter>());


    aws::s3 client("49.235.73.47:9000", "oaho11", "12345678");

    client.put_object<aws::sync>("hellworld", "img", std::string("this is image"),
            [](const Aws::S3::S3Client* client_ptr,
            const typename aws::policy_base::put_object_request_type& request,
            const typename Aws::S3::Model::PutObjectOutcome& outcome,
            const std::shared_ptr<const Aws::Client::AsyncCallerContext>& ptr){

            if(outcome.IsSuccess()){

            }
            else{
                ErrorL << outcome.GetError().GetMessage();
            }
    });


    return 0;
}
